package com.xc.videosample

import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentActivity
import androidx.viewpager2.adapter.FragmentStateAdapter

class ViewPage2Adapter(activity: FragmentActivity?, private val list: MutableList<Fragment>) :
    FragmentStateAdapter(
        activity!!
    ) {
    override fun createFragment(position: Int): Fragment {
        return list[position]
    }

    override fun getItemCount(): Int {
        return list.size
    }
}